//package xyz.erupt.flow.process.listener.impl.MonitorsImpl;
//
//import lombok.extern.slf4j.Slf4j;
//import lombok.var;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.ApplicationContext;
//import org.springframework.stereotype.Component;
//import xyz.erupt.flow.bean.entity.OaProcessInstance;
//import xyz.erupt.flow.process.listener.*;
//import xyz.erupt.upms.service.EruptContextService;
//import xyz.erupt.upms.service.EruptUserService;
//
///**
// * @author PP
// * @version 1.0
// * @project Erupt
// * @description 流程审批通过时监听(流程实例完成后监听)
// * @date 2024/8/30 15:18:52
// */
//@Slf4j
//@Component
//public class PassMonitor implements BeforeFinishInstanceListener {
//    //javaspringEl调用bean的上下文
//    @Autowired
//    ApplicationContext applicationContext;
//    @Autowired
//    EruptUserService eruptUserService;
//    @Autowired
//    EruptContextService eruptContextService;
//    @Autowired
//    ProcessNodeEngine processNodeEngine;
//    @Autowired
//    ProcessInstanceService processInstanceService;
//    @Override
//    public void execute(OaProcessInstance executableNode) {
//        log.info(executableNode.getFormName()+":流程结束");
//        var res = executableNode.getStatus();
//        if (OaProcessInstance.FINISHED == res){//结束代表流程通过审批，shutdown代表被驳回结束，但被驳回上一级等是running
//            var instance = processInstanceService.getById(executableNode.getId());//获取完整流程实例
//            var node = instance.getProcessNode();
//            var passes = node.getMonitors().getPassMonitors();
//            for (var pass:passes) {
//                Utils.DoMonitor(pass,instance,applicationContext,eruptContextService);//执行流程监听代码
//            }
//        }
//
//    }
//
//}
